import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '@/views/Home.vue'
import Cookbook from '@/views/cookbook/Index.vue'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/home/cookbook'
    },

    {
      path: '/home',
      component: Home,
      children: [
        {
          path: 'cookbook',
          component: Cookbook
        },
        {
          path: 'category',
          component: () => import('@/views/category/Index.vue'),
          children: [
            {
              path: 'cate',
              component: () => import('@/views/category/Category.vue'),
              meta: 1
            },
            {
              path: 'material',
              component: () => import('@/views/category/Material.vue'),
              meta: 2
            }
          ]
        },
        {
          path: 'location',
          component: () => import('@/views/location/Index.vue')
        },
        {
          path: 'more',
          component: () => import('@/views/more/More.vue')
        }
      ]
    },

    {
      path: '/list',
      name: 'list',
      component: () => import('@/views/List.vue')
    },

    {
      path: '/details',
      component: () => import('@/views/Details.vue')
    },

    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/Search.vue')
<<<<<<< HEAD
=======
    },

    {
      path: '/train',
      name: 'train',
      component: () => import('@/views/Train.vue')
>>>>>>> before-10-1
    }
  ]
})

export default router